#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @project: fastapi-common
# @Author : luzhiheng
# @Date : 2020/10/23
# @desc : sqlalchemy 数据库实体类基类 

from typing import Any

from sqlalchemy.ext.declarative import as_declarative, declared_attr


@as_declarative()
class Base:
    id: Any
    __name__: str

    @declared_attr
    def __tablename__(cls) -> str:
        return cls.__name__.lower()

